package com.cl.edu.entity;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.CascadeType;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Teacher entity.
 *  @author lihx
 */
@Entity
@Table(name = "teacher")
public class Teacher implements java.io.Serializable {

	// Fields

	private Long id;				//教师编号 自增 由10000开始
	private String username;		//用户名
	private String password;		//密码
	private Integer indentityFlag;	//身份
	private String  realname;		//真实姓名
	private String sex;			//性别
	private String birthday;				//出生日期
	private String nativePlace;
	private String bornPlace;		//nativePlace与bornPlace属性分别由中国人与外国人独有,由indentityFlag区分
	private String educationalLevel;//目前学历
	private String idCard;			//身份证/护照
	private String major;			//专业
	private String indentityStu;	//在校大学生具体身份
	private String indentityTea;	//教师具体身份
	private String indentityOut;	//外国人具体身份
	
	private String studySchool;
	private String studySchoolTxt;
	private String highSchool;		//在校大学生独有信息(就读高校，没有则填写的，高中母校)
	
	private String teaSchool2;
	private String teaSchoolTxt;	//其他人独有信息
	
	private String teaSchool;
	private String teaSchoolTxt2;
	private String teachSchool;
	private String teachSubject;
	private String importantLevel;
	private Integer teachAge;
	private String technicalLevel; //教师独有信息
	
	private String address1;			//生活住所
	private String address2;			//工作场所
	private String telephone;			//电话
	private String msn;					//msn
	private String mobile;				//手机
	private String qq;					//QQ
	private String email;				//email
	private String address3;			//通信地址
	private String postCode;			//邮编
	
	private Date regtime;				//注册时间
	private Date steptime;				//星级会员修改时间
	private Date passtime;				//通过认证时间
	private Integer state;				//状态
	private Integer step;				//级别
	
	
	
	//教员对应的简历
	
	private String firstSubject;		//可教授科目
	private String otherSubject;		//其它科目
	private String book;				//所获证书
	private String appraiseSelf;		//自我描述
	private String teachPlace;			//可教授区域
	private String teachPlaceDiscribe;	//可教授区域详细描述
	private String resume;				//家教简历(学员评价教学成果)
	private String teachModel;			//可辅导方式
	private String pay;					//薪水要求
	private String pubWay;				//获取本让途径
	private Integer jianliFlag;			//简历的状态
	
	
	private String photo;				//头像，由photos中选择一张
	private String photos;				//个人照片,最多6个，用@分隔
	private String cards;				//证件照片
	private Integer doStar; //是否做星级教员
	private Integer doContract;//是否做合同制家教
	private String introduceNum;//被介绍次数
	private String starNum;	//成为每周之星次数
	private Integer isWeekStar;//是否是一周之星 0为不是 是则显示1~8的展示顺序
	private String weekStarPhoto;//在一周之星中待显示的照片
	
	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "username", length = 20)
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "password", length = 32)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "indentity_flag")
	public Integer getIndentityFlag() {
		return this.indentityFlag;
	}

	public void setIndentityFlag(Integer indentityFlag) {
		this.indentityFlag = indentityFlag;
	}

	@Column(name = "born_place", length = 20)
	public String getBornPlace() {
		return this.bornPlace;
	}

	public void setBornPlace(String bornPlace) {
		this.bornPlace = bornPlace;
	}

	@Column(name = "educational_level")
	public String getEducationalLevel() {
		return this.educationalLevel;
	}

	public void setEducationalLevel(String educationalLevel) {
		this.educationalLevel = educationalLevel;
	}

	@Column(name = "id_card", length = 30)
	public String getIdCard() {
		return this.idCard;
	}

	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}

	@Column(name = "major", length = 50)
	public String getMajor() {
		return this.major;
	}

	public void setMajor(String major) {
		this.major = major;
	}

	@Column(name = "indentity_stu", length = 50)
	public String getIndentityStu() {
		return this.indentityStu;
	}

	public void setIndentityStu(String indentityStu) {
		this.indentityStu = indentityStu;
	}

	@Column(name = "indentity_tea", length = 50)
	public String getIndentityTea() {
		return this.indentityTea;
	}

	public void setIndentityTea(String indentityTea) {
		this.indentityTea = indentityTea;
	}

	@Column(name = "indentity_out", length = 50)
	public String getIndentityOut() {
		return this.indentityOut;
	}

	public void setIndentityOut(String indentityOut) {
		this.indentityOut = indentityOut;
	}

	@Column(name = "study_school", length = 50)
	public String getStudySchool() {
		return this.studySchool;
	}

	public void setStudySchool(String studySchool) {
		this.studySchool = studySchool;
	}

	@Column(name = "study_school_txt", length = 50)
	public String getStudySchoolTxt() {
		return this.studySchoolTxt;
	}

	public void setStudySchoolTxt(String studySchoolTxt) {
		this.studySchoolTxt = studySchoolTxt;
	}

	@Column(name = "high_school", length = 50)
	public String getHighSchool() {
		return this.highSchool;
	}

	public void setHighSchool(String highSchool) {
		this.highSchool = highSchool;
	}

	@Column(name = "tea_school2", length = 50)
	public String getTeaSchool2() {
		return this.teaSchool2;
	}

	public void setTeaSchool2(String teaSchool2) {
		this.teaSchool2 = teaSchool2;
	}

	@Column(name = "tea_school_txt", length = 50)
	public String getTeaSchoolTxt() {
		return this.teaSchoolTxt;
	}

	public void setTeaSchoolTxt(String teaSchoolTxt) {
		this.teaSchoolTxt = teaSchoolTxt;
	}

	@Column(name = "tea_school", length = 50)
	public String getTeaSchool() {
		return this.teaSchool;
	}

	public void setTeaSchool(String teaSchool) {
		this.teaSchool = teaSchool;
	}

	@Column(name = "tea_school_txt2", length = 50)
	public String getTeaSchoolTxt2() {
		return this.teaSchoolTxt2;
	}

	public void setTeaSchoolTxt2(String teaSchoolTxt2) {
		this.teaSchoolTxt2 = teaSchoolTxt2;
	}

	@Column(name = "teach_school", length = 50)
	public String getTeachSchool() {
		return this.teachSchool;
	}

	public void setTeachSchool(String teachSchool) {
		this.teachSchool = teachSchool;
	}

	@Column(name = "teach_subject", length = 50)
	public String getTeachSubject() {
		return this.teachSubject;
	}

	public void setTeachSubject(String teachSubject) {
		this.teachSubject = teachSubject;
	}

	@Column(name = "important_level", length = 50)
	public String getImportantLevel() {
		return this.importantLevel;
	}

	public void setImportantLevel(String importantLevel) {
		this.importantLevel = importantLevel;
	}

	@Column(name = "teach_age")
	public Integer getTeachAge() {
		return this.teachAge;
	}

	public void setTeachAge(Integer teachAge) {
		this.teachAge = teachAge;
	}

	@Column(name = "technical_level", length = 50)
	public String getTechnicalLevel() {
		return this.technicalLevel;
	}

	public void setTechnicalLevel(String technicalLevel) {
		this.technicalLevel = technicalLevel;
	}

	@Column(name = "address1", length = 50)
	public String getAddress1() {
		return this.address1;
	}

	public void setAddress1(String address1) {
		this.address1 = address1;
	}

	@Column(name = "address2", length = 50)
	public String getAddress2() {
		return this.address2;
	}

	public void setAddress2(String address2) {
		this.address2 = address2;
	}

	@Column(name = "telephone", length = 50)
	public String getTelephone() {
		return this.telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	@Column(name = "msn", length = 50)
	public String getMsn() {
		return this.msn;
	}

	public void setMsn(String msn) {
		this.msn = msn;
	}

	@Column(name = "mobile", length = 50)
	public String getMobile() {
		return this.mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	@Column(name = "qq", length = 50)
	public String getQq() {
		return this.qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	@Column(name = "email", length = 50)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "address3", length = 100)
	public String getAddress3() {
		return this.address3;
	}

	public void setAddress3(String address3) {
		this.address3 = address3;
	}

	@Column(name = "post_code", length = 50)
	public String getPostCode() {
		return this.postCode;
	}

	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}

	@Column(name = "realname", length = 20)
	public String getRealname() {
//		if(this.realname.length()>1){
//			return this.realname.substring(0, 1)+"教员";
//		}
		return this.realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	@Column(name = "sex")
	public String getSex() {
		return this.sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	
	@Column(name = "birthday", length =20)
	public String getBirthday() {
		return this.birthday;
	}

	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}

	@Column(name = "native_place", length = 20)
	public String getNativePlace() {
		return this.nativePlace;
	}

	public void setNativePlace(String nativePlace) {
		this.nativePlace = nativePlace;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "regtime", length = 10)
	public Date getRegtime() {
		return this.regtime;
	}

	public void setRegtime(Date regtime) {
		this.regtime = regtime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "passtime", length = 10)
	public Date getPasstime() {
		return this.passtime;
	}

	public void setPasstime(Date passtime) {
		this.passtime = passtime;
	}

	@Column(name = "state")
	public Integer getState() {
		return this.state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	@Column(name = "step")
	public Integer getStep() {
		return this.step;
	}

	public void setStep(Integer step) {
		this.step = step;
	}

	
	@Column(name = "first_subject", length = 500)
	public String getFirstSubject() {
		if(this.firstSubject!=null&&this.firstSubject.endsWith(",")){
			this.firstSubject=this.firstSubject.substring(0, this.firstSubject.length()-1);
		}
		return this.firstSubject.replaceAll("------------------,", "");
	}

	public void setFirstSubject(String firstSubject) {
		this.firstSubject = firstSubject;
	}

	@Column(name = "other_subject", length = 100)
	public String getOtherSubject() {
		return this.otherSubject;
	}

	public void setOtherSubject(String otherSubject) {
		this.otherSubject = otherSubject;
	}

	@Column(name = "book", length = 1000)
	public String getBook() {
		return this.book;
	}

	public void setBook(String book) {
		this.book = book;
	}

	@Column(name = "appraise_self", length = 600)
	public String getAppraiseSelf() {
		return this.appraiseSelf.trim();
	}

	public void setAppraiseSelf(String appraiseSelf) {
		this.appraiseSelf = appraiseSelf;
	}

	@Column(name = "teach_place", length = 500)
	public String getTeachPlace() {
		if(this.teachPlace!=null&&this.teachPlace.endsWith(",")){
			this.teachPlace=this.teachPlace.substring(0, this.teachPlace.length()-1);
		}
		return this.teachPlace;
	}

	public void setTeachPlace(String teachPlace) {
		this.teachPlace = teachPlace;
	}

	@Column(name = "teach_place_discribe", length = 500)
	public String getTeachPlaceDiscribe() {
		return this.teachPlaceDiscribe;
	}

	public void setTeachPlaceDiscribe(String teachPlaceDiscribe) {
		this.teachPlaceDiscribe = teachPlaceDiscribe;
	}

	@Column(name = "resume", length = 2000)
	public String getResume() {
		return this.resume;
	}

	public void setResume(String resume) {
		this.resume = resume;
	}

	@Column(name = "teach_model", length = 100)
	public String getTeachModel() {
		return this.teachModel;
	}

	public void setTeachModel(String teachModel) {
		this.teachModel = teachModel;
	}

	@Column(name = "pay", length = 100)
	public String getPay() {
		return this.pay;
	}

	public void setPay(String pay) {
		this.pay = pay;
	}

	@Column(name = "pub_way", length = 100)
	public String getPubWay() {
		return this.pubWay;
	}

	public void setPubWay(String pubWay) {
		this.pubWay = pubWay;
	}

	@Column(name = "jianli_flag")
	public Integer getJianliFlag() {
		return this.jianliFlag;
	}

	public void setJianliFlag(Integer jianliFlag) {
		this.jianliFlag = jianliFlag;
	}

	public String getPhoto() {
		return photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}

	public String getPhotos() {
		return photos;
	}

	public void setPhotos(String photos) {
		this.photos = photos;
	}

	public String getCards() {
		return cards;
	}

	public void setCards(String cards) {
		this.cards = cards;
	}
	@Column(name = "dostar")
	public Integer getDoStar() {
		return doStar;
	}

	public void setDoStar(Integer doStar) {
		this.doStar = doStar;
	}
	@Column(name = "docontract")
	public Integer getDoContract() {
		return doContract;
	}

	public void setDoContract(Integer doContract) {
		this.doContract = doContract;
	}

	@Column(name = "introduce_num")
	public String getIntroduceNum() {
		return introduceNum;
	}

	public void setIntroduceNum(String introduceNum) {
		this.introduceNum = introduceNum;
	}

	public void setSteptime(Date steptime) {
		this.steptime = steptime;
	}
	@Temporal(TemporalType.TIME)
	@Column(name = "steptime")
	public Date getSteptime() {
		return steptime;
	}

	@Column(name = "star_num")
	public String getStarNum() {
		return starNum;
	}

	public void setStarNum(String starNum) {
		this.starNum = starNum;
	}

	@Column(name = "is_week_star")
	public Integer getIsWeekStar() {
		return isWeekStar;
	}

	public void setIsWeekStar(Integer isWeekStar) {
		this.isWeekStar = isWeekStar;
	}
	
	@Column(name = "week_star_photo")
	public String getWeekStarPhoto() {
		return weekStarPhoto;
	}

	public void setWeekStarPhoto(String weekStarPhoto) {
		this.weekStarPhoto = weekStarPhoto;
	}


}